}
this._updateEntry(secret);
- // HACK: the question comes directly from PAM
- this.setQuestion(question.replace(/: *$/, '…').trim());
+
+ // Hack: The question string comes directly from PAM, if it's "Password:"
+ // we replace it with our own to allow localization, if it's something
+ // else we remove the last colon and any trailing or leading spaces.
+ if (question === 'Password:' || question === 'Password: ')
+ this.setQuestion(_('Password'));
+ else
+ this.setQuestion(question.replace(/: *$/, '').trim());
this.updateSensitivity(true);
this.emit('prompted');